package com.myjob.test.comm;

import android.content.Context;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.graphics.Canvas;
import android.graphics.Paint;
import android.graphics.Point;
import android.location.Location;

import com.google.android.maps.GeoPoint;
import com.google.android.maps.MapView;
import com.google.android.maps.MyLocationOverlay;
import com.myjob.R;

public class MyLocation extends MyLocationOverlay {

	Context mContext;
	
	public MyLocation(Context context, MapView mapView) {
		super(context, mapView);
		mContext = context;
	}
	
	@Override
	protected void drawMyLocation(Canvas canvas, MapView mapView, Location lastFix, GeoPoint myLocation, long when) {
		super.drawMyLocation(canvas, mapView, lastFix, myLocation, when);
		
		Paint paint = new Paint();
		
		Point point = mapView.getProjection().toPixels(myLocation, null);
		
		Bitmap bitMap = BitmapFactory.decodeResource(mContext.getResources(), R.drawable.arrow_man_32);
		canvas.drawBitmap(bitMap, point.x, point.y, paint);
	}

	
}